Optimal. Leaf size=49 \[ \frac {3 x}{2}-\frac {3 \text {ArcTan}(x)}{2}-\frac {1}{2} x^2 \text {ArcTan}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \text {ArcTan}(x) \log \left (1+x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 8, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {4946, 327, 209,
2504, 2436, 2332, 5139, 2498} \begin {gather*} -\frac {1}{2} x^2 \text {ArcTan}(x)+\frac {1}{2} \left (x^2+1\right ) \text {ArcTan}(x) \log \left (x^2+1\right )-\frac {3 \text {ArcTan}(x)}{2}-\frac {1}{2} x \log \left (x^2+1\right )+\frac {3 x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 327
Rule 2332
Rule 2436
Rule 2498
Rule 2504
Rule 4946
Rule 5139
Rubi steps
\begin {align*} \int x \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \left (-\frac {x^2}{2 \left (1+x^2\right )}+\frac {1}{2} \log \left (1+x^2\right )\right ) \, dx\\ &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )+\frac {1}{2} \int \frac {x^2}{1+x^2} \, dx-\frac {1}{2} \int \log \left (1+x^2\right ) \, dx\\ &=\frac {x}{2}-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{2} \int \frac {1}{1+x^2} \, dx+\int \frac {x^2}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {1}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \frac {1}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {3}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 38, normalized size = 0.78 \begin {gather*} \frac {1}{2} \left (3 x-3 \text {ArcTan}(x)-x^2 \text {ArcTan}(x)+\left (-x+\left (1+x^2\right ) \text {ArcTan}(x)\right ) \log \left (1+x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 3.10, size = 762, normalized size = 15.55
method | result | size |
default | \(\left (-i \arctan \left (x \right )+x \arctan \left (x \right )-1\right ) \left (x +i\right ) \ln \left (\frac {i x +1}{\sqrt {x^{2}+1}}\right )+\frac {i \left (3-2 i \arctan \left (x \right ) \ln \left (2\right ) x^{2}+2 i \arctan \left (x \right ) \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right ) x^{2}+\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} x^{2}-\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) x^{2}+i \pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2}+\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} x +\pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} x -\arctan \left (x \right ) \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) x^{2}+i \arctan \left (x \right ) x^{2}-\pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} x +2 i \arctan \left (x \right ) \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )-2 i \ln \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right ) x +2 i \ln \left (2\right ) x -2 \ln \left (2\right )-i \pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )+\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) \arctan \left (x \right )-2 i \ln \left (2\right ) \arctan \left (x \right )+\pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3} \arctan \left (x \right )-i \pi \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{3}-\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \arctan \left (x \right )-\pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2} \arctan \left (x \right )+i \pi \,\mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right )^{2}-\pi \,\mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) \mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) x -3 i x +5 i \arctan \left (x \right )+\arctan \left (x \right ) \pi \,\mathrm {csgn}\left (\frac {i}{\sqrt {x^{2}+1}}\right ) \mathrm {csgn}\left (i \left (\frac {\left (i x +1\right )^{2}}{x^{2}+1}+1\right )\right ) \mathrm {csgn}\left (\frac {i \sqrt {x^{2}+1}}{i x +1}\right ) x^{2}\right )}{2}\) | \(762\) |
risch | \(\text {Expression too large to display}\) | \(15978\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.55, size = 39, normalized size = 0.80 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} - {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \arctan \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.27, size = 33, normalized size = 0.67 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} + 3\right )} \arctan \left (x\right ) + \frac {1}{2} \, {\left ({\left (x^{2} + 1\right )} \arctan \left (x\right ) - x\right )} \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.26, size = 56, normalized size = 1.14 \begin {gather*} \frac {x^{2} \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {x^{2} \operatorname {atan}{\left (x \right )}}{2} - \frac {x \log {\left (x^{2} + 1 \right )}}{2} + \frac {3 x}{2} + \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )}}{2} - \frac {3 \operatorname {atan}{\left (x \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs.
\(2 (39) = 78\).
time = 0.38, size = 86, normalized size = 1.76 \begin {gather*} \frac {1}{4} \, \pi x^{2} \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \pi x^{2} \mathrm {sgn}\left (x\right ) + \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) + \frac {1}{4} \, \pi \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) - \frac {1}{2} \, \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \frac {3}{2} \, \arctan \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.47, size = 48, normalized size = 0.98 \begin {gather*} \frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}-x\,\left (\frac {\ln \left (x^2+1\right )}{2}-\frac {3}{2}\right )-x^2\,\left (\frac {\mathrm {atan}\left (x\right )}{2}-\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )}{2}\right )-\frac {3\,\mathrm {atan}\left (x\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________